package com.dongdong.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.dongdong.mapper.TbItemCatMapper;
import com.dongdong.pojo.TbItemCat;
import com.dongdong.service.ItemCatService;
import org.springframework.stereotype.Component;


import javax.annotation.Resource;
import java.util.List;

/**
 * @Deacription TODO
 * @Author Lenovo
 * @Date 2020/12/11 15:52
 * @Version 1.0
 **/
@Service
@Component
public class ItemCatServiceImpl implements ItemCatService {

    @Resource
    private TbItemCatMapper itemCatMapper;

    @Override
    public List<TbItemCat> selectItemCat(Integer id) {
        return itemCatMapper.selectItemCat(id);
    }

    @Override
    public int deleteBatch(Long[] ids) {
        return itemCatMapper.deleteBatch(ids);
    }

    @Override
    public List<TbItemCat> getItem(Long parentId) {
        return itemCatMapper.getItem(parentId);
    }

    @Override
    public List<TbItemCat> getItems() {
        return itemCatMapper.selectByExample(null);
    }

    @Override
    public Long getTypeId(Long typeId) {
        return itemCatMapper.getTypeId(typeId);
    }

    @Override
    public int updateInfo(TbItemCat tbItemCat) {
        return itemCatMapper.updateByPrimaryKeySelective(tbItemCat);
    }

    @Override
    public int insertItemCat(TbItemCat tbItemCat) {
        return itemCatMapper.insertSelective(tbItemCat);
    }

    @Override
    public TbItemCat getItemCatById(Long id) {
        return itemCatMapper.selectByPrimaryKey(id);
    }
}

